Instead of having BABL_CLASS() plus variants and making the macros
authorMartin Nordholts <martinn@src.gnome.org>
Sat, 17 Jan 2009 13:33:49 +0000 (13:33 +0000)
committerMartin Nordholts <martinn@src.gnome.org>
Sat, 17 Jan 2009 13:33:49 +0000 (13:33 +0000)
expand to different things depending on if they are used in a
header or a .c file, have two versions: BABL_CLASS_DECLARE() and
BABL_CLASS_IMPLEMENT(). This enables further refactorisations of
the babl.h header.

* babl.h: Do the name changes and remove the unpleasant #undefs at
the bottom.

* babl-internal.h: Do the name changes.

* babl-component.[ch]
* babl-conversion.[ch]
* babl-extension.[ch]
* babl-fish.[ch]
* babl-format.[ch]
* babl-image.h
* babl-model.[ch]
* babl-sampling.h
* babl-type.[ch]: Adjust to changes.

svn path=/trunk/; revision=370

19 files changed:
ChangeLog
babl/babl-component.c
babl/babl-component.h
babl/babl-conversion.c
babl/babl-conversion.h
babl/babl-extension.c
babl/babl-extension.h
babl/babl-fish.c
babl/babl-fish.h
babl/babl-format.c
babl/babl-format.h
babl/babl-image.h
babl/babl-internal.h
babl/babl-model.c
babl/babl-model.h
babl/babl-sampling.h
babl/babl-type.c
babl/babl-type.h
babl/babl.h

index 0b71f24dceea542547ae520820b3ed52f56a4bc1..13d44a6805fe18a1dfd04c48883680c2b0990ba6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2009-01-17  Martin Nordholts  <martinn@svn.gnome.org>
+
+       Instead of having BABL_CLASS() plus variants and making the macros
+       expand to different things depending on if they are used in a
+       header or a .c file, have two versions: BABL_CLASS_DECLARE() and
+       BABL_CLASS_IMPLEMENT(). This enables further refactorisation of
+       the babl.h header.
+
+       * babl.h: Do the name changes and remove the unpleasant #undefs at
+       the bottom.
+
+       * babl-internal.h: Do the name changes.
+
+       * babl-component.[ch]
+       * babl-conversion.[ch]
+       * babl-extension.[ch]
+       * babl-fish.[ch]
+       * babl-format.[ch]
+       * babl-image.h
+       * babl-model.[ch]
+       * babl-sampling.h
+       * babl-type.[ch]: Adjust to changes.
+
 2009-01-17  Martin Nordholts  <martinn@svn.gnome.org>
 
        Don't redeclare functions declared with the BABL_CLASS() or
index 4c84bba01dde92ffd2d475d14a30be4a87f3bf92..45a9b0acc6ce7ad243122d7bfea26b75aa3d4fd3 100644 (file)
@@ -127,4 +127,4 @@ babl_component_new (void *first_arg,
   return babl;
 }
 
-BABL_CLASS (component)
+BABL_CLASS_IMPLEMENT (component)
index 6cfae073666aa65766a756296002f43d009cec78..98dadc5332dcd07f515cc132604f530e65162099 100644 (file)
@@ -23,7 +23,7 @@
 
 /****************************************************************/
 /* BablComponent */
-BABL_NAMED_CLASS (component);
+BABL_NAMED_CLASS_DECLARE (component);
 /*
  * Babl * babl_component_new (const char *name,
  *                            NULL);
index 7c028b56692b54e49c820cfabbb4d8f43e5fdf14..173cdf3d01e320e612d33ddf050ae22bb3b55ba5 100644 (file)
@@ -555,4 +555,4 @@ babl_conversion_error (BablConversion *conversion)
   return error;
 }
 
-BABL_CLASS (conversion)
+BABL_CLASS_IMPLEMENT (conversion)
index d5d609f41dfcd033771050c62ab40fcd6c5a4b1c..8b0ca8a2954281e5f76eb6ccd726317920d81425 100644 (file)
@@ -22,7 +22,7 @@
 
 /****************************************************************/
 /* BablConversion */
-BABL_NAMED_CLASS (conversion);
+BABL_NAMED_CLASS_DECLARE (conversion);
 /*
  * Babl * babl_conversion_new (<BablFormat *source, BablFormat *destination|
  *                              BablModel  *source, BablModel  *destination|
index 921f7f45f551673cf46029629a3b34ce93e197cf..e8866aca694a7979f522fda2a8fb68d4ba8b281b 100644 (file)
@@ -357,4 +357,4 @@ each_babl_extension_destroy (Babl *babl,
   return 0;  /* continue iterating */
 }
 
-BABL_CLASS (extension)
+BABL_CLASS_IMPLEMENT (extension)
index 723198b0e4bd7e59fc202f4dd42895f4728a2a2c..6cba1e9e40a9c7e44df67c9a3f460d2b962717c8 100644 (file)
@@ -22,7 +22,7 @@
 
 /****************************************************************/
 /* BablExtension */
-BABL_NAMED_CLASS (extension);
+BABL_NAMED_CLASS_DECLARE (extension);
 /*
  * BablExtension objects are only used internally in babl.
  */
index 8d7c37eaf3efaed4f2c7ef0a8741bd5026ea1ea7..a7b5cf7fd2a61d39355dad100906f5d36d9444f8 100644 (file)
@@ -335,4 +335,4 @@ each_babl_fish_destroy (Babl *babl,
   return 0;  /* continue iterating */
 }
 
-BABL_CLASS_MINIMAL (fish);
+BABL_CLASS_MINIMAL_IMPLEMENT (fish);
index 938d43bcfd80ce73ab7292457d3e7b6ed4964284..13333664be42923bb950a0b8ffb6fac19e0fac58 100644 (file)
@@ -22,7 +22,7 @@
 
 /****************************************************************/
 /* BablFish */
-BABL_CLASS (fish);
+BABL_CLASS_DECLARE (fish);
 /*  Create a babl fish capable of converting from source_format to
  *  destination_format, source and destination can be
  *  either strings with the names of the formats or BablFormat objects.
index bc080c615f5294f9e29dc7203945a665571916be..2696dd0011fcf66147157fb78fbcc0afbc53a663 100644 (file)
@@ -436,4 +436,4 @@ babl_format_loss (Babl *babl)
   return loss;
 }
 
-BABL_CLASS (format)
+BABL_CLASS_IMPLEMENT (format)
index d8cb04d82b216dade11204551149865ce2585486..d584f727cf5096438a2a394fa872538ab99cc882 100644 (file)
@@ -22,7 +22,7 @@
 
 /****************************************************************/
 /* BablFormat */
-BABL_NAMED_CLASS (format);
+BABL_NAMED_CLASS_DECLARE (format);
 /*
  * Babl * babl_format_new (["name", const char *name,]
  *                          BablModel          *model,
index 8d4fc6edbe49daeda872f080ce70829776c3af13..52769ffef4e6310d64f2b74127c121ab4fdd774f 100644 (file)
@@ -22,7 +22,7 @@
 
 /****************************************************************/
 /* BablImage */
-BABL_CLASS (image);
+BABL_CLASS_DECLARE (image);
 /*
  * Babl images can be used for planar buffers instead of linear buffers for
  * babl_process(), BablImages are still experimental, for now BablImages can be
index 4a3422a30266cfcc0555d86ba45241f0c5904216..7275fcbdb164e032fc4643598e4143994f698934 100644 (file)
@@ -209,7 +209,7 @@ void         babl_internal_destroy (void);
  * to be kept in sync with the C files.
  */
 
-#define BABL_CLASS_MINIMAL(klass)                             \
+#define BABL_CLASS_MINIMAL_IMPLEMENT(klass)                   \
 void                                                          \
 babl_##klass##_init (void)                                    \
 {                                                             \
@@ -235,8 +235,8 @@ babl_##klass##_each (BablEachFunction  each_fun,              \
   babl_db_each (db, each_fun, user_data);                     \
 }                                                             \
 
-#define BABL_CLASS(klass)                                     \
-BABL_CLASS_MINIMAL(klass)                                     \
+#define BABL_CLASS_IMPLEMENT(klass)                           \
+BABL_CLASS_MINIMAL_IMPLEMENT(klass)                           \
                                                               \
 Babl *                                                        \
 babl_##klass (const char *name)                               \
index 5fd49085aea22caed83faeb6d523af6cfc3aa574..e7e59ca317a6a9629636554c72b25884aa236d29 100644 (file)
@@ -327,4 +327,4 @@ babl_model_is_symmetric (Babl *babl)
   return symmetric;
 }
 
-BABL_CLASS (model)
+BABL_CLASS_IMPLEMENT (model)
index ec2dd65610d6220f7a0acd2c6b169d1f09a36f9d..494f4b6924eb8fd5f5a8360df38857fd298f64d9 100644 (file)
@@ -22,7 +22,7 @@
 
 /****************************************************************/
 /* BablModel */
-BABL_NAMED_CLASS (model);
+BABL_NAMED_CLASS_DECLARE (model);
 /*
  * Babl * babl_model_new (["name", const char *name,]
  *                        BablComponent *component1,
index 0e772d1b1b689d246de9c3b73fd2f7e50e78a31d..4b67470f5d494e5cb7bde4d8f383da5a8da45cd1 100644 (file)
@@ -22,7 +22,7 @@
 
 /****************************************************************/
 /* BablSampling */
-BABL_CLASS (sampling);
+BABL_CLASS_DECLARE (sampling);
 /**/
 Babl * babl_sampling       (int horizontal,
                             int vertical);
index 399d831d89e3dbedc8c4a8701ee710c199cdff19..a1537acf6c729ba8b859367d2bd773dae701136b 100644 (file)
@@ -252,4 +252,4 @@ babl_type_is_symmetric (Babl *babl)
   return is_symmetrical;
 }
 
-BABL_CLASS (type)
+BABL_CLASS_IMPLEMENT (type)
index dd4857fdcc158d0ab3188f5fd2c0024082f3407b..ec3662c318e22d542deae429d450561e8ea5688d 100644 (file)
@@ -22,7 +22,7 @@
 
 /****************************************************************/
 /* BablType */
-BABL_NAMED_CLASS (type);
+BABL_NAMED_CLASS_DECLARE (type);
 /*
  * A data type that babl can have in it's buffers, requires
  * conversions to and from "double" to be registered before
index a1e99a164953556fe372775bf803a65518b9e485..8283db379745400df6fe7a76343d7326e2fd1160 100644 (file)
@@ -84,7 +84,7 @@ typedef int  (*BablEachFunction) (Babl *entry,
  * to be iterated over, common functionality is defined through these
  * macros.
  */
-#define BABL_CLASS(klass)                                    \
+#define BABL_CLASS_DECLARE(klass)                            \
                                                              \
 void   babl_##klass##_init    (void);                        \
 void   babl_##klass##_destroy (void);                        \
@@ -98,9 +98,9 @@ void   babl_##klass##_each    (BablEachFunction  each_fun,   \
  * the means to lookup by name, as well as to create new named objects
  * that later can be looked up.
  */
-#define BABL_NAMED_CLASS(klass)                              \
+#define BABL_NAMED_CLASS_DECLARE(klass)                      \
                                                              \
-BABL_CLASS (klass);                                          \
+BABL_CLASS_DECLARE (klass);                                  \
 Babl * babl_##klass           (const char       *name);      \
 Babl * babl_##klass##_new     (void             *first_arg,  \
                                ...) BABL_ARG_NULL_TERMINATED
@@ -163,7 +163,4 @@ typedef union _Babl
   BablExtension     extension;
 } _Babl;
 
-#undef BABL_CLASS
-#undef BABL_NAMED_CLASS
-
 #endif